package com.egreen.pointsmall;


/*import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;

import com.baomidou.mybatisplus.generator.config.po.TableFill;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;

import java.util.ArrayList;
import java.util.List;*/


//代码自动生成器
public class codecreate {
    public static void main(String[] args) {
      /*  AutoGenerator autoGenerator = new AutoGenerator();
        //数据源配置
        DataSourceConfig source = new DataSourceConfig();
        source.setDriverName("com.mysql.cj.jdbc.Driver");
        source.setUrl("jdbc:mysql://localhost:3306/db_pointmall?serverTimezone=UTC");
        source.setUsername("root");
        source.setPassword("root");
        autoGenerator.setDataSource(source);

        //配置生成目录信息
        GlobalConfig globalConfig = new GlobalConfig();
        globalConfig.setOutputDir(System.getProperty("user.dir") + "/pointsmall/src/main/java");
        globalConfig.setOpen(false);
        globalConfig.setAuthor("yyf");
        globalConfig.setMapperName("%sDao");
        globalConfig.setFileOverride(false);
        autoGenerator.setGlobalConfig(globalConfig);

        //配置生成包信息
        PackageConfig packageConfig = new PackageConfig();
        packageConfig.setParent("com.example.pointsmall");
        packageConfig.setMapper("dao");
        packageConfig.setXml("dao.xml");
        packageConfig.setEntity("pojo.entity");
        autoGenerator.setPackageInfo(packageConfig);

        //表策略配置
        StrategyConfig strategyConfig = new StrategyConfig();
        strategyConfig.setTablePrefix("tb_");
        strategyConfig.setRestControllerStyle(true);
        strategyConfig.setLogicDeleteFieldName("deleted");
        strategyConfig.setEntityLombokModel(true);
        strategyConfig.setNaming(NamingStrategy.underline_to_camel);
        strategyConfig.setColumnNaming(NamingStrategy.underline_to_camel);
        List<TableFill> list = new ArrayList<>();
        //设置自动更新创建时间与修改时间
        TableFill tableFill1 = new TableFill("create_time", FieldFill.INSERT);
        TableFill tableFill2 = new TableFill("update_time",FieldFill.INSERT_UPDATE);
        list.add(tableFill1);
        list.add(tableFill2);

        strategyConfig.setTableFillList(list);
        autoGenerator.setStrategy(strategyConfig);

        autoGenerator.execute();*/
    }
}
